﻿<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <script src="resource/lib/jquery-1.10.2.js"></script>
    <script src="resource/lib/d3.js"></script>
    <script src="svgJs/svg-utils.js"></script>
    <script src="svgJs/svg-baseClass.js"></script>
    <script src="svgJs/d3-text.js"></script>
    <script src="svgJs/d3-container.js"></script>
    <script src="svgJs/d3-rect.js"></script>
    <script src="svgJs/d3-image.js"></script>
    <script src="svgJs/d3-line.js"></script>
    <script src="svgJs/navigation.js"></script>
    <script src="svgJs/processContainer.js"></script>
    <script src="svgJs/scopeContainer.js"></script>
    <script src="svgJs/pickContainer.js"></script>
    <script src="svgJs/catchContainer.js"></script>
    <script src="svgJs/onMessageContainer.js"></script>
    <script src="svgJs/onEventContainer.js"></script>
    <script src="svgJs/compensationHandlerContainer.js"></script>
</head>
<body>
    <div style="width:100%" id="svgContainer"></div>
</body>
</html>
<script>
    /*  scope group的type需要做个map  */

    var svg = d3.select("#svgContainer")
       .append("svg")
       .attr("width", "100%")
       .attr("height", 1000)
       .style("border", "none");
    var diagram = new Diagram(svg);
    var textPaddingTop = 11;
    var processEl = null;

    var worker = new Worker("svgJs/worker.js");
    worker.onmessage = function (e) {
        console.log(e.data.msg);
    }

    worker.onerror = function (error) {
        console.log(error.filename + "--" + error.message + "--" + error.lineno);
    }

    var leftSvgDom = [];
    var rightSvgDom = [];

    function getQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return unescape(r[2]); return null;
    }


    $(function () {
        var url = getQueryString("path");
        $.ajax({
            url: './resource/xml/SVG04.xml',//url,//SVG04//Events//Books//SVGFault//SubSVG//TimeSVG
            dataType: 'xml',
            success: function (data) {
                xmlNode2WfElement(diagram, null, $(data).find("process"), $(data));
                var n = new navigation($(data));
                n.renderNavigation(diagram, $(data).find("process").attr("width"));
            }
        });
    })
    
</script>
